package com.yamanyar.weebill.view;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.yamanyar.weebill.domain.Project;
import com.yamanyar.weebill.service.ProjectService;

/**
 * Lists projects. Created in Jun 28, 2008.
 * 
 * @author Kaan Yamanyar
 */
@Component("listProject")
@Scope("request")
public class ListProjects implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3156916209497186641L;
	private List<Project> projects;
	private ProjectService projectService;

	@Autowired
	public ListProjects(ProjectService projectService) {
		this.projectService = projectService;
		projects = this.projectService.findAll();
	}

	public List<Project> getProjects() {
		return projects;
	}

	public void setProjects(List<Project> projects) {
		this.projects = projects;
	}

}
